package com.cqq.auth.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cqq.auth.dao.UserMenuDao;
import com.cqq.auth.dao.domain.UserMenu;
import com.cqq.auth.dao.mapper.UserMenuMapper;
import com.cqq.common.core.base.BaseDao;
import com.cqq.common.core.base.BaseQuery;

/**
 * <h3>用户菜单配置Dao接口实现类</h3>
 * 
 * @author xijq
 * @version 1.0.0
 * 
 */
@Repository("userMenuDao")
public class UserMenuDaoImpl extends BaseDao implements UserMenuDao {
	
	@Autowired
	private UserMenuMapper userMenuMapper;

	
	public void add(UserMenu obj) {
		userMenuMapper.add(obj);
	}

	
	public Integer delete(Serializable id) {
		return userMenuMapper.delete(id);
	}

	
	public Integer update(UserMenu obj) {
		return userMenuMapper.update(obj);
	}

	
	public UserMenu queryById(Serializable id) {
		return userMenuMapper.queryById(id);
	}

	
	public List<UserMenu> queryAll() {
		return null;
	}

	
	public List<UserMenu> queryPage(BaseQuery query) {
		return null;
	}

	
	public Integer queryCount(BaseQuery query) {
		return null;
	}

	
	public List<UserMenu> queryByUserId(Integer id, String systemCode) {
		return userMenuMapper.queryByUserId(id, systemCode);
	}

	
	public UserMenu queryByUserIdAndMenuId(Integer userId, Integer menuId) {
		return userMenuMapper.queryByUserIdAndMenuId(userId, menuId);
	}

	
	public void deleteByUserIdAndParentId(Integer userId, Integer parentId, String systemCode) {
		userMenuMapper.deleteByUserIdAndParentId(userId, parentId, systemCode);
	}

	
	public void updateIndex(Integer userId, Integer parentId,
			String systemCode, Integer menuId, Integer newIndex,
			Integer oldIndex) {
		userMenuMapper.updateIndex(userId, parentId, systemCode, menuId, newIndex, oldIndex);
	}

	
	public List<UserMenu> queryByUserIdAndParentId(Integer userId,
			Integer parentId, String systemCode) {
		return userMenuMapper.queryByUserIdAndParentId(userId, parentId, systemCode);
	}

	
	public void deleteByUserIdAndMenuId(Integer userId, Integer menuId) {
		userMenuMapper.deleteByUserIdAndMenuId(userId, menuId);
	}

}
